<?php
    session_start();
    require_once dirname(__FILE__) . '/shared/config/config.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_LIBRARIES . 'lib_date.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_LIBRARIES . 'lib_pager.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_security.php';

    $title = 'Home Page';

    $email = filter_input(INPUT_GET, "email");
    $activate_code = filter_input(INPUT_GET, "activate_code");
    if (!api_security::activate($email, $activate_code)) {
        $error_show = "Sorry, this email $email maybe have already registered or not found in our system.";
    } else {
        $success_info = "Activate Successully! You are now a member.";
    }
?>

<!DOCTYPE html>
<!-- IE SECTION -->

<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->

                     <!-- END IE SECTION -->
<html>
<head>
    <?php require_once DOCUMENT_ROOT . DIR_INCLUDE . 'head.php' ?>
</head>
<body>

<div class="ts-body-container">
            <div class="ts-wrapper">
                <div class="padding-top-large row">
                    <?php
                    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'header.php';
                    ?>
                    <div class="ui segment breadcrumb" style="margin-top: 25px; margin-left: 20px;">
                        <a class="section" href="index.php">Home</a>
                        <i class="right arrow icon divider"></i>
                        <a class="active section">Login</a>
                    </div>
                </div>
                <div class="ui grid">
                    <div class="row">
                        <div class="column">
                            <h1>Verify Account</h1>
                            <?php if (!empty($error_show)) { ?>
                                <div class="ui error message">
                                    <i class="close icon"></i>
                                    <div class="header">
                                        Please correct these wrongs.
                                    </div>
                                    <ul class="list">
                                        <?php echo $error_show; ?>
                                    </ul>
                                </div>
                            <?php } else if (!empty($success_info)) {
                                ?>
                                <div class="ui success message">
                                    <i class="close icon"></i>
                                    <div class="header">
                                        <?php echo $success_info; ?>
                                    </div>
                                </div>
                                <?php
                            }
                            ?>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <?php
                    require_once DOCUMENT_ROOT . DIR_INCLUDE . 'footer.php';
                    ?>
                </div>
            </div>
        </div>
</body>
</html>